﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PreviewAppraisal.aspx.cs" Inherits="Appraisal.Web.ZB.PreviewAppraisal" %>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>无标题页</title>
    <link href="../CSS/Default/Style.css" rel="stylesheet" type="text/css" />
    <script language="javascript">
    function printToExcel(html) {
        try {
            var ExApp = new ActiveXObject("Excel.Application")
            var ExWBk = ExApp.workbooks.add()
            var ExWSh = ExWBk.worksheets(1)
            ExApp.DisplayAlerts = false
            ExApp.visible = true
        } catch (err) {
            alert(err.description)
            return false
        }
        window.clipboardData.setData("Text", html);
        ExWBk.worksheets(1).Select;
        ExWBk.worksheets(1).Range("A1:Z900").NumberFormatLocal = "@";

        ExWBk.worksheets(1).Paste;
        //ExWBk.worksheets(1).Columns.AutoFit;
        //ExWBk.worksheets(1).Rows.AutoFit;
    }
    
    
	function excel()
	{

	    var newstr = document.all.item('p1').innerHTML;
	    printToExcel(newstr);

	}
	 
</script>    
</head>
<body MS_POSITIONING="FlowLayout" topMargin="1">
    <form id="form1" runat="server">
			<TABLE id="Table1" class="ms-toolbar" cellSpacing="0" cellPadding="0">
				<TR>
					<TD width="2"><IMG alt="" src="../Appraisal/Images/blank.gif" width="2" height="1"></TD>
					<TD class="ms-toolbar">
						<TABLE id="Table2" border="0" cellSpacing="0" cellPadding="1">
							<TR>
							<TD class="ms-toolbar" noWrap>
								    <asp:imagebutton id="Imagebutton1" runat="server" 
                                        ImageUrl="../Images/Default/undo.gif"></asp:imagebutton>
								</TD>
							    <TD noWrap><A class="ms-toolbar" href="javascript:history.go(-1);">返回</A></TD>
							    <TD class="ms-separator">&nbsp;|&nbsp;</TD>
								<TD class="ms-toolbar" noWrap>
								    <asp:imagebutton id="btnImgSave" runat="server" 
                                        ImageUrl="../Images/Default/print.gif"></asp:imagebutton>
								</TD>
								<TD noWrap><asp:linkbutton id="btnPrint" runat="server" CssClass="ms-toolbar">打印</asp:linkbutton></TD>
							</TR>
						</TABLE>
					</TD>
					<TD width="100%"><IMG alt="" src="../Appraisal/Images/blank.gif" width="1" 
                            height="22"> </TD>
				</TR>
			</TABLE>
			                    <asp:Panel ID="p1" runat="server">
                                </asp:Panel>
    </form>
</body>
</html>
